<#include "/common/include.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="修改字典数据"/>
<@addorEdit fromId="form-dict-edit">
	<input name="dictCode"  type="hidden" value="${dictHtml.dictCode}" />
	<div class="form-group">
		<label class="col-sm-3 control-label "><span style="color: red; ">*</span>字典标签：</label>
		<div class="col-sm-8">
			<input class="form-control" type="text" name="dictLabel" id="dictLabel" value="${dictHtml.dictLabel?default("")}" required>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label "><span style="color: red; ">*</span>字典键值：</label>
		<div class="col-sm-8">
			<input class="form-control" type="text" name="dictValue" id="dictValue" value="${dictHtml.dictValue?default("")}" required>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label">字典类型：</label>
		<div class="col-sm-8">
			<input class="form-control" type="text" name="dictType"  readonly="true" value="${dictHtml.dictType?default("")}">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label"><span style="color: red; ">*</span>系统内置：</label>
		<div class="col-sm-8">
			<#list dict.getType('sys_yes_no')>
				<#items as d>
					<#if d.status =='0' >
						<div class="radio-box">
							<input type="radio" id="${d.dictCode}" name="isSys"
								   value="${d.dictValue}"  <#if d.isDefault == dictHtml.isSys >checked</#if>>
							<label for="${d.dictCode}" text="${d.dictLabel}">${d.dictLabel}</label>
						</div>
					</#if>
				</#items>
			</#list>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label">CSS类名：</label>
		<div class="col-sm-8">
			<input class="form-control" type="text" id="cssClass" name="cssClass" value="${dictHtml.cssClass?default("")}">
			<span class="help-block m-b-none"><i class="fa fa-info-circle" style="color: red"></i> 如:class="red", 请填写:red</span>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label">CSS样式：</label>
		<div class="col-sm-8">
			<input class="form-control" type="text" name="cssStyle" value="${dictHtml.cssStyle?default("")}">
			<span class="help-block m-b-none"><i class="fa fa-info-circle" style="color: red"></i> 如：style="color:red", 请填写：color:red</span>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label"><span style="color: red; ">*</span>字典排序：</label>
		<div class="col-sm-8">
			<input class="form-control" type="text" name="dictSort" value="${dictHtml.dictSort?default("")}" required>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label"><@ctx.i18n text = "回显样式"/>：
			<a tabindex="0" role="button" data-toggle="popover" data-trigger="focus" title="<@ctx.i18n text = "回显样式"/>"
			   data-content="table表格字典列显示样式属性">
				<i class="fa fa-question-circle-o" style="color: orange"></i></a>
		</label>
		<div class="col-sm-8">
			<select name="listClass" class="form-control m-b">
				<option value="" <#if dictHtml.listClass?default("") =='' >selected="selected"</#if>>---请选择---</option>
				<option value="default" <#if dictHtml.listClass?default("") =='default' >selected="selected"</#if>>默认--default</option>
				<option value="primary" <#if dictHtml.listClass?default("") =='primary' >selected="selected"</#if>>主要--primary</option>
				<option value="success" <#if dictHtml.listClass?default("") =='success' >selected="selected"</#if>>成功--success</option>
				<option value="info"    <#if dictHtml.listClass?default("") =='info' >selected="selected"</#if>>信息--info</option>
				<option value="warning" <#if dictHtml.listClass?default("") =='warning' >selected="selected"</#if>>警告--warning</option>
				<option value="danger"  <#if dictHtml.listClass?default("") =='danger' >selected="selected"</#if>>危险--danger</option>
			</select>
<#--			<span class="help-block m-b-none"><i class="fa fa-info-circle" style="color: orange"></i> table表格字典列显示样式属性</span>-->
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label"><span style="color: red; ">*</span>系统默认：</label>
		<div class="col-sm-8">
			<#list dict.getType('sys_yes_no')>
				<#items as d>
					<#if d.status =='0' >
						<div class="radio-box">
							<input type="radio" id="${d.dictCode}" name="isDefault"
								   value="${d.dictValue}"  <#if d.isDefault == dictHtml.isDefault >checked</#if>>
							<label for="${d.dictCode}" text="${d.dictLabel}">${d.dictLabel}</label>
						</div>
					</#if>
				</#items>
			</#list>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label"><span style="color: red; ">*</span>状态：</label>
		<div class="col-sm-8">
			<#list dict.getType('sys_normal_disable')>
				<#items as d>
					<#if d.status =='0' >
						<div class="radio-box">
							<input type="radio" id="${d.dictCode}" name="status"
								   value="${d.dictValue}"  <#if d.dictValue == dictHtml.status >checked</#if>>
							<label for="${d.dictCode}" text="${d.dictLabel}">${d.dictLabel}</label>
						</div>
					</#if>
				</#items>
			</#list>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label">备注：</label>
		<div class="col-sm-8">
			<textarea id="remark" name="remark" class="form-control">${dictHtml.remark?default("")}</textarea>
		</div>
	</div>
</@addorEdit>
<@footer>
<script>
	var prefix = baseURL + "sys/dict/data";

	$("#form-dict-edit").validate({
		rules:{
			dictSort:{
				digits:true
			},
		},
		focusCleanup: true
	});

	function submitHandler() {
		if (opt.validate.form()) {
			opt.operate.save(prefix + "/edit", $('#form-dict-edit').serialize());
		}
	}
</script>
</@footer>
</@pageTheme>